package com.kystar.muxplayer.model;

import android.util.Size;

public class Output {
    // 0: 复制模式, 1: 水平模式, 2: 垂直模式, 3: 田字模式
    private int concatIndex;
    // 0xff 自定义
    private int screenSizeId;
    private Size screenSize;
    private FreqType frequency;
    private Size[] sizes = new Size[4];



    public Size size() {
        Size size0 = sizes[0];
        switch (concatIndex) {
            case 0: // 复制模式
                return new Size(size0.getWidth(), size0.getHeight());
            case 1: {// 水平模型
                int width = sizes[0].getWidth() + sizes[1].getWidth() + sizes[2].getWidth() + sizes[3].getWidth();
                return new Size(width, size0.getHeight());
            }
            case 2: {//  垂直模式
                int height = sizes[0].getHeight() + sizes[1].getHeight() + sizes[2].getHeight() + sizes[3].getHeight();
                return new Size(size0.getWidth(), height);
            }
            case 3: {//  田字模式
                int width = sizes[0].getWidth() + sizes[2].getWidth();
                int height = sizes[1].getHeight() + sizes[3].getHeight();
                return new Size(width, height);
            }
            default:
        }
        return null;
    }

    public int getConcatIndex() {
        return concatIndex;
    }

    public void setConcatIndex(int concatIndex) {
        this.concatIndex = concatIndex;
    }

    public int getScreenSizeId() {
        return screenSizeId;
    }

    public void setScreenSizeId(int screenSizeId) {
        this.screenSizeId = screenSizeId;
    }

    public Size getScreenSize() {
        return screenSize;
    }

    public void setScreenSize(Size screenSize) {
        this.screenSize = screenSize;
    }

    public FreqType getFrequency() {
        return frequency;
    }

    public void setFrequency(FreqType frequency) {
        this.frequency = frequency;
    }

    public Size[] getSizes() {
        return sizes;
    }

    public void setSizes(Size[] sizes) {
        this.sizes = sizes;
    }
}
